<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>模型</title>
</head>
<body>
<table id="models"></table>
</body>
<script src="js/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
    function deployModel(id){
        $.ajax({
            type: "GET",
            url: "/proc/deploy",
            data: {"id":id},
            dateType: "json",
            success: function (res) {
                alert(res);
            }
        });
    }

    $(function () {
        $.ajax({
            type:"GET",
            url:"/model/list",
            data:{
            },
            dateType:"json",
            success:function (res) {
                $("#models").empty();
                console.log(res)
                var i;
                for (i = 0; i < res.length; i++) {
                    var item = res[i];
                    var tr = $("<tr>");
                    var t1 = $("<td>");
                    var a = $("<a>");
                    a.attr("href","/modeler.html?modelId="+item.id);
                    a.append(item.id)
                    t1.append(a)
                    var t2 = $("<td>");
                    t2.append(item.name);
                    var t3 = $("<td>");
                    t3.append(item.key);
                    var t4 = $("<td>");
                    t4.append(item.meatInfo);
                    var t5 = $("<td>");
                    t5.append(item.version);
                    var t6 = $("<td>");
                    t6.append(item.createTime);

                    var t7 =  $("<input>")
                    t7.attr("type","button")
                    t7.val("部署");
                    t7.attr("onclick","deployModel("+item.id+")")

                    tr.append(t1);
                    tr.append(t2);
                    tr.append(t3);
                    tr.append(t4);
                    tr.append(t5);
                    tr.append(t6);
                    tr.append(t7);
                    $("#models").append(tr);
                }
            }})
    })



    // <mxGraphModel>
    // <root>
    // <mxCell id="0" />
    // <mxCell id="1" parent="0" />
    // <mxCell id="ff8080817719a82b01771ef750e800f4" value="1.开始" style="startNode" parent="1" vertex="1">
    // <mxGeometry x="200" y="330" width="64" height="64" as="geometry" />
    // </mxCell>
    // <mxCell id="ff8080817719a82b0177227a312c0123" value="节点4" style="activityNode" parent="1" vertex="1">
    // <mxGeometry x="540" y="220" width="100" height="48" as="geometry" />
    // </mxCell>
    // <mxCell id="ff8080817719a82b0177227a31480125" value="节点5" style="activityNode" parent="1" vertex="1">
    // <mxGeometry x="810" y="338" width="100" height="48" as="geometry" />
    // </mxCell>
    // <mxCell id="ff8080817719a82b0177227a31560126" value="节点3" style="activityNode" parent="1" vertex="1">
    // <mxGeometry x="360" y="220" width="100" height="48" as="geometry" />
    // </mxCell>
    // <mxCell id="ff8080817719a82b0177227a319a012b" value="" parent="1" source="ff8080817719a82b0177227a31560126" target="ff8080817719a82b0177227a312c0123" edge="1">
    // <mxGeometry relative="1" as="geometry" />
    // </mxCell>
    // <mxCell id="ff8080817719a82b0177227a31a5012c" value="" parent="1" source="ff8080817719a82b0177227a312c0123" target="ff8080817719a82b0177227a31480125" edge="1">
    // <mxGeometry relative="1" as="geometry">
    // <Array as="points">
    // <mxPoint x="860" y="240" />
    // </Array>
    // </mxGeometry>
    // </mxCell>
    // <mxCell id="ff8080817719a82b0177227a31610127" value="0.归档" style="endNode" parent="1" vertex="1">
    // <mxGeometry x="1020" y="330" width="64" height="64" as="geometry" />
    // </mxCell>
    // <mxCell id="ff8080817719a82b0177227a31ba012e" value="" parent="1" source="ff8080817719a82b0177227a31480125" target="ff8080817719a82b0177227a31610127" edge="1">
    // <mxGeometry relative="1" as="geometry" />
    // </mxCell>
    // <mxCell id="ff80808177230a080177240e1fb40026" value="节点2" style="activityNode" parent="1" vertex="1">
    // <mxGeometry x="460" y="338" width="100" height="48" as="geometry" />
    // </mxCell>
    // <mxCell id="ff80808177230a080177240e1ffc0027" value="" parent="1" source="ff8080817719a82b01771ef750e800f4" target="ff80808177230a080177240e1fb40026" edge="1">
    // <mxGeometry relative="1" as="geometry" />
    // </mxCell>
    // <mxCell id="ff80808177230a080177240e200a0028" value="" parent="1" source="ff8080817719a82b01771ef750e800f4" target="ff8080817719a82b0177227a31560126" edge="1">
    // <mxGeometry relative="1" as="geometry">
    // <Array as="points">
    // <mxPoint x="230" y="300" />
    // </Array>
    // </mxGeometry>
    // </mxCell>
    // <mxCell id="ff8080817724354301772437a4ee0000" value="" parent="1" source="ff80808177230a080177240e1fb40026" target="ff8080817719a82b0177227a31480125" edge="1">
    // <mxGeometry relative="1" as="geometry" />
    // </mxCell>
    // </root>
    // </mxGraphModel>
</script>
</html>
